package com.ffcs.crmd.tsp.admin.control;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ctg.itrdc.platform.common.entity.PageInfo;
import com.ctg.itrdc.platform.common.exception.ExceptionUtil;
import com.ffcs.crmd.platform.pub.vo.RetVo;
import com.ffcs.crmd.tsp.admin.api.dto.JobDetailTrackDTO;
import com.ffcs.crmd.tsp.admin.api.facade.IJobDetailDeathTrackFacade;

/**
 * 
 * 功能说明:子任务转移轨迹控制层
 *
 * @author ZHONGFUHUA
 * 
 * @Date 2016年2月16日 下午4:49:00
 *
 *
 * 版本号  |   作者   |  修改时间   |   修改内容
 *
 */
@Controller
@ResponseBody
@RequestMapping("/tsp/jobDetailTrack")
public class JobDetailTrackController {
    
    private final Logger               logger = LoggerFactory.getLogger(JobDetailTrackController.class);
    
    @Autowired
    private IJobDetailDeathTrackFacade transferTrackFacade;
    
    /**
     * 
     * 功能说明:查询死任务转移轨迹
     * 
     * @author ZHONGFUHUA
     *
     * @Date 2016年2月17日
     *
     */
    @RequestMapping(value = "/queryPage")
    public RetVo queryPage(ModelMap map, HttpSession httpSession, @RequestBody JobDetailTrackDTO jobDetailTrackDTO) {
        RetVo retVo = new RetVo(true);
        try {
            PageInfo<JobDetailTrackDTO> pageInfo = transferTrackFacade.queryPage(jobDetailTrackDTO);
            retVo.setPageInfo(pageInfo);
        } catch (Exception e) {
            logger.info("JobDetailTrackController: query job detail track exception:", e);
            retVo.setResult(false);
            retVo.setMsgTitle(e.getMessage());
            retVo.setDetailMsg(ExceptionUtil.getTraceInfo(e));
        }
        return retVo;
    }
    
}
